* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #f0f2f5;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 260px;
    background: #001529;
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.brand {
    padding: 20px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.brand h1 {
    font-size: 20px;
    margin-bottom: 8px;
}

.brand-desc {
    font-size: 14px;
    opacity: 0.8;
}

.user-info {
    margin-top: auto;
    padding: 20px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info i {
    font-size: 24px;
}

.logout-btn {
    margin-left: auto;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.logout-btn:hover {
    opacity: 1;
}

/* 主内容区域样式 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
}

.chat-header {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-title i {
    color: #1890ff;
    font-size: 20px;
}

.header-title h2 {
    font-size: 18px;
    color: #333;
}

.status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.status.online i {
    color: #52c41a;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: #f8f9fa;
}

.message {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    max-width: 88%;
    animation: messageSlideIn 0.3s ease-out;
}

.ai-message {
    align-items: flex-start;
    padding-left: 36px;
}

.user-message {
    align-items: flex-end;
    margin-left: auto;
}

.message-content {
    padding: 16px 20px;
    border-radius: 18px;
    position: relative;
    max-width: 85%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-left: 16px;
}

.user-message .message-content {
    background: linear-gradient(135deg, #1890ff, #096dd9);
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-message .message-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
}

.chat-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid #f0f0f0;
}

.input-wrapper {
    display: flex;
    gap: 12px;
    background: white;
    padding: 4px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

textarea {
    flex: 1;
    padding: 14px;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    resize: none;
    font-size: 14px;
    transition: all 0.3s;
    line-height: 1.6;
}

textarea:focus {
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24,144,255,0.1);
    outline: none;
}

button {
    padding: 0 28px;
    background: #1890ff;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

button:hover {
    background: #40a9ff;
    transform: translateY(-1px);
}

button:disabled {
    background: #d9d9d9;
    cursor: not-allowed;
}

.input-tips {
    margin-top: 8px;
    font-size: 12px;
    color: #999;
    text-align: right;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .chat-messages {
        padding: 10px;
    }
    
    .message {
        max-width: 90%;
    }
}

/* Markdown 样式优化 */
.ai-message .message-content {
    font-size: 14px;
    line-height: 1.6;
    padding: 16px 20px;
}

.ai-message .message-content p {
    margin: 0 0 12px 0;
}

.ai-message .message-content p:last-child {
    margin-bottom: 0;
}

.ai-message .message-content ul,
.ai-message .message-content ol {
    margin: 8px 0;
    padding-left: 24px;
}

.ai-message .message-content li {
    margin: 6px 0;
}

.ai-message .message-content pre {
    background: #f6f8fa;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 12px 0;
}

.ai-message .message-content code {
    background: #f6f8fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 13px;
}

/* 等待指示器和响应时间样式 */
.waiting-indicator,
.response-time {
    font-size: 12px;
    color: #8c8c8c;
    margin-top: 6px;
    margin-left: 12px;
    opacity: 0.8;
}

/* 临时消息样式 */
.temp-message {
    text-align: center;
    color: #ff4d4f;
    padding: 8px;
    margin: 8px 0;
    font-size: 14px;
    animation: fadeInOut 3s ease-in-out;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { opacity: 0; }
}

.message-content img.emoji {
    height: 1.2em;
    width: 1.2em;
    margin: 0 .05em 0 .1em;
    vertical-align: -0.1em;
}

/* 添加消息出现动画 */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 消息底部样式 */
.message-footer {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid rgba(0,0,0,0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.feedback-section {
    width: 100%;
    justify-content: flex-end;
}

.feedback-question {
    font-size: 12px;
    color: #999;
}

.feedback-buttons {
    display: flex;
    gap: 6px;
}

.feedback-btn {
    padding: 3px 10px;
    font-size: 12px;
}

.feedback-btn:hover {
    background: #e8e8e8;
    transform: none;
}

.feedback-btn.yes:hover {
    color: #52c41a;
    border-color: #52c41a;
    background: rgba(82,196,26,0.1);
}

.feedback-btn.no:hover {
    color: #ff4d4f;
    border-color: #ff4d4f;
    background: rgba(255,77,79,0.1);
}

.feedback-btn.selected {
    pointer-events: none;
}

.feedback-btn.yes.selected {
    background: #52c41a;
    color: white;
    border-color: #52c41a;
}

.feedback-btn.no.selected {
    background: #ff4d4f;
    color: white;
    border-color: #ff4d4f;
}

.message-text {
    margin-bottom: 12px;
    margin-left: 0;
}

/* 修改消息头部样式 */
.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    margin-left: 16px;
    position: relative;
}

.message-header .avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    position: absolute;
    left: -36px;
    top: 0;
}

.message-header .agent-name {
    font-size: 13px;
    color: #666;
}

/* 调整反馈部分的间距 */
.message-footer {
    margin-left: 0;
} 